<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang>
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/blog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/blog/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT">





  <link rel="alternate" href="/blog/atom.xml" title="编程那点事" type="application/atom+xml">






<meta name="description" content="为何使用Gitee而不是GitHub目前国内访问GitHub速度慢，还可能被墙，所以Gitee来构建个人博客。Gitee类似国内版的GitHub，访问速度有保证。 环境要求GitNodeJs默认你已经安装了Git和NodeJS(推荐使用cnpm) 开始搭建1. 安装Hexo1打开 shell 终端，输入命令`npm install -g hexo` 123456789101112131415161">
<meta property="og:type" content="article">
<meta property="og:title" content="使用Gitee+Hexo搭建个人博客">
<meta property="og:url" content="https://lhweb.gitee.io/blog/2018/09/22/使用Gitee-Hexo搭建个人博客/index.html">
<meta property="og:site_name" content="编程那点事">
<meta property="og:description" content="为何使用Gitee而不是GitHub目前国内访问GitHub速度慢，还可能被墙，所以Gitee来构建个人博客。Gitee类似国内版的GitHub，访问速度有保证。 环境要求GitNodeJs默认你已经安装了Git和NodeJS(推荐使用cnpm) 开始搭建1. 安装Hexo1打开 shell 终端，输入命令`npm install -g hexo` 123456789101112131415161">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2019-10-03T05:53:45.942Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="使用Gitee+Hexo搭建个人博客">
<meta name="twitter:description" content="为何使用Gitee而不是GitHub目前国内访问GitHub速度慢，还可能被墙，所以Gitee来构建个人博客。Gitee类似国内版的GitHub，访问速度有保证。 环境要求GitNodeJs默认你已经安装了Git和NodeJS(推荐使用cnpm) 开始搭建1. 安装Hexo1打开 shell 终端，输入命令`npm install -g hexo` 123456789101112131415161">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://lhweb.gitee.io/blog/2018/09/22/使用Gitee-Hexo搭建个人博客/">





  <title>使用Gitee+Hexo搭建个人博客 | 编程那点事</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="default">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">编程那点事</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            Archives
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://lhweb.gitee.io/blog/blog/2018/09/22/使用Gitee-Hexo搭建个人博客/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="lhweb">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="编程那点事">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">使用Gitee+Hexo搭建个人博客</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-09-22T21:17:49+08:00">
                2018-09-22
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="为何使用Gitee而不是GitHub"><a href="#为何使用Gitee而不是GitHub" class="headerlink" title="为何使用Gitee而不是GitHub"></a>为何使用Gitee而不是GitHub</h3><p>目前国内访问GitHub速度慢，还可能被墙，所以Gitee来构建个人博客。Gitee类似国内版的GitHub，访问速度有保证。</p>
<h3 id="环境要求"><a href="#环境要求" class="headerlink" title="环境要求"></a>环境要求</h3><p>Git<br>NodeJs<br>默认你已经安装了Git和NodeJS(推荐使用cnpm)</p>
<h3 id="开始搭建"><a href="#开始搭建" class="headerlink" title="开始搭建"></a>开始搭建</h3><h4 id="1-安装Hexo"><a href="#1-安装Hexo" class="headerlink" title="1. 安装Hexo"></a>1. 安装Hexo</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">打开 shell 终端，输入命令`npm install -g hexo`</span><br></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br></pre></td><td class="code"><pre><span class="line">$ sudo cnpm install -g hexo</span><br><span class="line"></span><br><span class="line">Password:</span><br><span class="line">Downloading hexo to /usr/<span class="built_in">local</span>/lib/node_modules/hexo_tmp</span><br><span class="line">Copying /usr/<span class="built_in">local</span>/lib/node_modules/hexo_tmp/_hexo@3.7.1@hexo to /usr/<span class="built_in">local</span>/lib/node_modules/hexo</span><br><span class="line">Installing hexo<span class="string">'s dependencies to /usr/local/lib/node_modules/hexo/node_modules</span></span><br><span class="line"><span class="string">[1/27] abbrev@^1.0.7 installed at node_modules/_abbrev@1.1.1@abbrev</span></span><br><span class="line"><span class="string">[2/27] archy@^1.0.0 installed at node_modules/_archy@1.0.0@archy</span></span><br><span class="line"><span class="string">[3/27] hexo-i18n@^0.2.1 installed at node_modules/_hexo-i18n@0.2.1@hexo-i18n</span></span><br><span class="line"><span class="string">[4/27] js-yaml@^3.6.1 existed at node_modules/_js-yaml@3.12.0@js-yaml</span></span><br><span class="line"><span class="string">[5/27] bluebird@^3.4.0 installed at node_modules/_bluebird@3.5.1@bluebird</span></span><br><span class="line"><span class="string">[6/27] chalk@^2.3.1 installed at node_modules/_chalk@2.4.1@chalk</span></span><br><span class="line"><span class="string">[7/27] hexo-front-matter@^0.2.2 installed at node_modules/_hexo-front-matter@0.2.3@hexo-front-matter</span></span><br><span class="line"><span class="string">[8/27] minimatch@^3.0.4 installed at node_modules/_minimatch@3.0.4@minimatch</span></span><br><span class="line"><span class="string">[9/27] pretty-hrtime@^1.0.2 installed at node_modules/_pretty-hrtime@1.0.3@pretty-hrtime</span></span><br><span class="line"><span class="string">[10/27] hexo-util@^0.6.3 installed at node_modules/_hexo-util@0.6.3@hexo-util</span></span><br><span class="line"><span class="string">[11/27] hexo-cli@^1.1.0 installed at node_modules/_hexo-cli@1.1.0@hexo-cli</span></span><br><span class="line"><span class="string">[12/27] resolve@^1.5.0 installed at node_modules/_resolve@1.8.1@resolve</span></span><br><span class="line"><span class="string">[13/27] strip-indent@^2.0.0 installed at node_modules/_strip-indent@2.0.0@strip-indent</span></span><br><span class="line"><span class="string">[14/27] strip-ansi@^4.0.0 installed at node_modules/_strip-ansi@4.0.0@strip-ansi</span></span><br><span class="line"><span class="string">[15/27] text-table@^0.2.0 installed at node_modules/_text-table@0.2.0@text-table</span></span><br><span class="line"><span class="string">[16/27] tildify@^1.2.0 existed at node_modules/_tildify@1.2.0@tildify</span></span><br><span class="line"><span class="string">[17/27] titlecase@^1.1.2 installed at node_modules/_titlecase@1.1.2@titlecase</span></span><br><span class="line"><span class="string">[18/27] moment@^2.19.4 installed at node_modules/_moment@2.22.2@moment</span></span><br><span class="line"><span class="string">[19/27] moment-timezone@^0.5.14 installed at node_modules/_moment-timezone@0.5.21@moment-timezone</span></span><br><span class="line"><span class="string">[20/27] hexo-log@^0.2.0 installed at node_modules/_hexo-log@0.2.0@hexo-log</span></span><br><span class="line"><span class="string">[21/27] swig-extras@0.0.1 installed at node_modules/_swig-extras@0.0.1@swig-extras</span></span><br><span class="line"><span class="string">[22/27] lodash@^4.17.5 installed at node_modules/_lodash@4.17.10@lodash</span></span><br><span class="line"><span class="string">[23/27] cheerio@0.22.0 installed at node_modules/_cheerio@0.22.0@cheerio</span></span><br><span class="line"><span class="string">fsevents@1.2.4 download from binary mirror: &#123;"module_name":"fse","module_path":"./lib/binding/&#123;configuration&#125;/&#123;node_abi&#125;-&#123;platform&#125;-&#123;arch&#125;/","remote_path":"./v&#123;version&#125;/","package_name":"&#123;module_name&#125;-v&#123;version&#125;-&#123;node_abi&#125;-&#123;platform&#125;-&#123;arch&#125;.tar.gz","host":"https://cdn.npm.taobao.org/dist/fsevents"&#125;</span></span><br><span class="line"><span class="string">[24/27] nunjucks@^3.1.2 installed at node_modules/_nunjucks@3.1.3@nunjucks</span></span><br><span class="line"><span class="string">[25/27] swig-templates@^2.0.2 installed at node_modules/_swig-templates@2.0.2@swig-templates</span></span><br><span class="line"><span class="string">[26/27] hexo-fs@^0.2.0 installed at node_modules/_hexo-fs@0.2.3@hexo-fs</span></span><br><span class="line"><span class="string">[27/27] warehouse@^2.2.0 installed at node_modules/_warehouse@2.2.0@warehouse</span></span><br><span class="line"><span class="string">execute post install 2 scripts...</span></span><br><span class="line"><span class="string">[1/2] scripts.postinstall nunjucks@^3.1.2 run "node postinstall-build.js src"</span></span><br><span class="line"><span class="string">[1/2] scripts.postinstall nunjucks@^3.1.2 finished in 109ms</span></span><br><span class="line"><span class="string">[2/2] scripts.install hexo-fs@0.2.3 › chokidar@1.7.0 › fsevents@^1.0.0 run "node install"</span></span><br><span class="line"><span class="string">[fsevents] Success: "/usr/local/lib/node_modules/hexo/node_modules/_fsevents@1.2.4@fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed</span></span><br><span class="line"><span class="string">Pass --update-binary to reinstall or --build-from-source to recompile</span></span><br><span class="line"><span class="string">[2/2] scripts.install hexo-fs@0.2.3 › chokidar@1.7.0 › fsevents@^1.0.0 finished in 306ms</span></span><br><span class="line"><span class="string">deprecate titlecase@^1.1.2 no longer maintained</span></span><br><span class="line"><span class="string">Recently updated (since 2018-08-01): 1 packages (detail see file /usr/local/lib/node_modules/hexo/node_modules/.recently_updates.txt)</span></span><br><span class="line"><span class="string"> 2018-08-06</span></span><br><span class="line"><span class="string">   → resolve@1.8.1 › path-parse@^1.0.5(1.0.6) (14:32:36)</span></span><br><span class="line"><span class="string">All packages installed (280 packages installed from npm registry, used 4s, speed 1.65MB/s, json 236(1.51MB), tarball 5.8MB)</span></span><br><span class="line"><span class="string">[hexo@3.7.1] link /usr/local/bin/hexo@ -&gt; /usr/local/lib/node_modules/hexo/bin/hexo</span></span><br></pre></td></tr></table></figure>
<p>注：如果提示权限错误，命令前加sudo,cnpm 是淘宝的开源镜像，国内访问比npm快。</p>
<h4 id="2-初始化Hexo"><a href="#2-初始化Hexo" class="headerlink" title="2. 初始化Hexo"></a>2. 初始化Hexo</h4><p>在你的电脑上创建Hexo文件夹，在shell终端中切换到Hexo目录，输入命令 hexo init<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cd</span> /work/Hexo </span><br><span class="line">/work/Hexo $ hexo init</span><br><span class="line">INFO  Cloning hexo-starter to /work/Hexo</span><br><span class="line">Cloning into <span class="string">'/work/Hexo'</span>...</span><br><span class="line">remote: Counting objects: 65, <span class="keyword">done</span>.</span><br><span class="line">remote: Total 65 (delta 0), reused 0 (delta 0), pack-reused 65</span><br><span class="line">Unpacking objects: 100% (65/65), <span class="keyword">done</span>.</span><br><span class="line">Submodule <span class="string">'themes/landscape'</span> (https://github.com/hexojs/hexo-theme-landscape.git) registered <span class="keyword">for</span> path <span class="string">'themes/landscape'</span></span><br><span class="line">Cloning into <span class="string">'/work/Hexo/themes/landscape'</span>...</span><br><span class="line">^Cwarning: Clone succeeded, but checkout failed.</span><br><span class="line">You can inspect what was checked out with <span class="string">'git status'</span></span><br><span class="line">and retry the checkout with <span class="string">'git checkout -f HEAD'</span></span><br><span class="line"></span><br><span class="line">INFO  See you again</span><br></pre></td></tr></table></figure></p>
<p>初始化完成后Hexo的目录结构：<br>初始化后目录结构</p>
<h4 id="3-获取博客主题"><a href="#3-获取博客主题" class="headerlink" title="3. 获取博客主题"></a>3. 获取博客主题</h4><p>在shell中输入命令：git clone <a href="https://gitee.com/xiuxiuing/hexo-theme-even" target="_blank" rel="noopener">https://gitee.com/xiuxiuing/hexo-theme-even</a> themes/even<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">/work/Hexo $ git <span class="built_in">clone</span> https://gitee.com/xiuxiuing/hexo-theme-even themes/even</span><br><span class="line">Cloning into <span class="string">'themes/even'</span>...</span><br><span class="line">remote: Counting objects: 136, <span class="keyword">done</span>.</span><br><span class="line">remote: Compressing objects: 100% (123/123), <span class="keyword">done</span>.</span><br><span class="line">remote: Total 136 (delta 4), reused 128 (delta 2)</span><br><span class="line">Receiving objects: 100% (136/136), 264.27 KiB | 556.00 KiB/s, <span class="keyword">done</span>.</span><br><span class="line">Resolving deltas: 100% (4/4), <span class="keyword">done</span>.</span><br></pre></td></tr></table></figure></p>
<p>克隆完成后，在/Hexo/themes目录下，可以看到 landscape和even 两个文件夹。<br>我们所要使用的主题都是放在这个目录下，Hexo默认使用的是landscape主题，由于第二步Hexo初始化时主题没有clone成功，所以我们这一步克隆了even主题，接下来会使用even主题进行演示。<br>想获取更多主题，可在网站：<a href="https://hexo.io/themes/" target="_blank" rel="noopener">https://hexo.io/themes/</a> 选择自己喜欢的主题，按照此步的步骤clone下来。</p>
<h4 id="4-config-yml对博客进行基础配置"><a href="#4-config-yml对博客进行基础配置" class="headerlink" title="4. _config.yml对博客进行基础配置"></a>4. _config.yml对博客进行基础配置</h4><p>_config.yml文件修改，保存</p>
<p>_config.yml</p>
<h4 id="5-本地预览博客"><a href="#5-本地预览博客" class="headerlink" title="5. 本地预览博客"></a>5. 本地预览博客</h4><p>编译项目，输入命令：hexo g<br>运行项目，输入命令：hexo s<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">$ hexo g</span><br><span class="line">INFO  Start processing</span><br><span class="line">INFO  Files loaded <span class="keyword">in</span> 186 ms</span><br><span class="line">INFO  Generated: archives/2018/08/index.html</span><br><span class="line">INFO  Generated: archives/index.html</span><br><span class="line">INFO  Generated: archives/2018/index.html</span><br><span class="line">INFO  Generated: index.html</span><br><span class="line">INFO  Generated: 2018/08/08/hello-world/index.html</span><br><span class="line">INFO  5 files generated <span class="keyword">in</span> 242 ms</span><br><span class="line">$ hexo s</span><br><span class="line">INFO  Start processing</span><br><span class="line">INFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.</span><br></pre></td></tr></table></figure></p>
<p>在浏览器中输入<code>http://localhost:4000/`</code>就可以看到效果啦</p>
<h3 id="部署博客到Gitee上"><a href="#部署博客到Gitee上" class="headerlink" title="部署博客到Gitee上"></a>部署博客到Gitee上</h3><h4 id="1-创建Gitee账号"><a href="#1-创建Gitee账号" class="headerlink" title="1. 创建Gitee账号"></a>1. 创建Gitee账号</h4><p>到码云：<a href="https://gitee.com/" target="_blank" rel="noopener">https://gitee.com/</a> 上申请注册账号，码云类似国内版的GitHub，所以操作界面跟GitHub差不多，多了一些国产化的东西，这里不做更多介绍了，自己研究下。</p>
<h4 id="2-创建项目"><a href="#2-创建项目" class="headerlink" title="2. 创建项目"></a>2. 创建项目</h4><p>创建项目</p>
<p>创建完成后，在项目中复制项目地址。</p>
<h4 id="3-在-config-yml中配置Git"><a href="#3-在-config-yml中配置Git" class="headerlink" title="3. 在_config.yml中配置Git"></a>3. 在_config.yml中配置Git</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">deploy:</span><br><span class="line">  <span class="built_in">type</span>: git</span><br><span class="line">  repo: https://gitee.com/xiuxiuing/blog.git</span><br><span class="line">  branch: master</span><br></pre></td></tr></table></figure>
<p>注意：冒号后面一定要有空格，否则不能正确识别。</p>
<h4 id="4-发布到Gitee"><a href="#4-发布到Gitee" class="headerlink" title="4. 发布到Gitee"></a>4. 发布到Gitee</h4><p>输入命令npm install hexo-deployer-git –save 安装自动部署发布工具<br>输入命令hexo clean &amp;&amp; hexo g &amp;&amp; hexo d 发布博客，首次发布需要在shell中输入账号和密码。</p>
<h4 id="5-Gitee-Pages设置"><a href="#5-Gitee-Pages设置" class="headerlink" title="5. Gitee Pages设置"></a>5. Gitee Pages设置</h4><p>在项目的服务中选择Pages选项<br>Pages</p>
<p>选择 master分支，点击 部署/更新<br>部署</p>
<p>稍等一会儿博客就发布成功啦，访问博客地址：<a href="https://xiuxiuing.gitee.io/blog，就可预览在线博客啦！！！" target="_blank" rel="noopener">https://xiuxiuing.gitee.io/blog，就可预览在线博客啦！！！</a><br>如果博客的样式不对，则需要在_config.yml中配置下博客地址和路径：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">url: https://xiuxiuing.gitee.io/blog/</span><br><span class="line">root: /blog</span><br></pre></td></tr></table></figure></p>
<p>再执行命令hexo clean &amp;&amp; hexo g &amp;&amp; hexo d 就可以啦。</p>
<p>至此，我们的博客就搭建完成啦！！！<br>在/Hexo/source/_posts目录下就可以写我们的博客啦！！！</p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/blog/2018/09/22/React-with-TypeScript-系列-一-概述/" rel="prev" title="React with TypeScript 系列(一) --概述">
                React with TypeScript 系列(一) --概述 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            Overview
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">lhweb</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/blog/archives/">
              
                  <span class="site-state-item-count">39</span>
                  <span class="site-state-item-name">posts</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/blog/categories/index.html">
                  <span class="site-state-item-count">6</span>
                  <span class="site-state-item-name">categories</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/blog/tags/index.html">
                  <span class="site-state-item-count">25</span>
                  <span class="site-state-item-name">tags</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/blog/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#为何使用Gitee而不是GitHub"><span class="nav-number">1.</span> <span class="nav-text">为何使用Gitee而不是GitHub</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#环境要求"><span class="nav-number">2.</span> <span class="nav-text">环境要求</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#开始搭建"><span class="nav-number">3.</span> <span class="nav-text">开始搭建</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1-安装Hexo"><span class="nav-number">3.1.</span> <span class="nav-text">1. 安装Hexo</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-初始化Hexo"><span class="nav-number">3.2.</span> <span class="nav-text">2. 初始化Hexo</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-获取博客主题"><span class="nav-number">3.3.</span> <span class="nav-text">3. 获取博客主题</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#4-config-yml对博客进行基础配置"><span class="nav-number">3.4.</span> <span class="nav-text">4. _config.yml对博客进行基础配置</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#5-本地预览博客"><span class="nav-number">3.5.</span> <span class="nav-text">5. 本地预览博客</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#部署博客到Gitee上"><span class="nav-number">4.</span> <span class="nav-text">部署博客到Gitee上</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1-创建Gitee账号"><span class="nav-number">4.1.</span> <span class="nav-text">1. 创建Gitee账号</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-创建项目"><span class="nav-number">4.2.</span> <span class="nav-text">2. 创建项目</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-在-config-yml中配置Git"><span class="nav-number">4.3.</span> <span class="nav-text">3. 在_config.yml中配置Git</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#4-发布到Gitee"><span class="nav-number">4.4.</span> <span class="nav-text">4. 发布到Gitee</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#5-Gitee-Pages设置"><span class="nav-number">4.5.</span> <span class="nav-text">5. Gitee Pages设置</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">lhweb</span>

  
</div>


  <div class="powered-by">Powered by <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a></div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">Theme &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/blog/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
